package sketch.semantics;

import java.util.Vector;

import sketch.doc.Sketch;

public class Relation {

	private Sketch sketch;

	private Vector<Concept> operants;

	public Sketch getSketch() {
		return sketch;
	}

	public Vector<Concept> getOperants() {
		return operants;
	}

	public void addOperant(Concept concept) {
		getOperants().add(concept);
	}

	public Relation() {
		operants = new Vector<Concept>();
	}

	public int getNumberOfOperants() {
		return getOperants().size();
	}

	public boolean isUnary() {
		return getNumberOfOperants() == 1;
	}

	public boolean isBinary() {
		return getNumberOfOperants() == 2;
	}

	public boolean isTrinary() {
		return getNumberOfOperants() == 3;
	}

	public boolean isQuadnary() {
		return getNumberOfOperants() == 4;
	}

	public String toString() {
		return getName() + "(operants:" + getNumberOfOperants() + ")";
	}

	public String getName() {
		return this.getClass().getSimpleName();
	}
}
